<!--
 * @Author: szx
 * @Date: 2022-07-20 17:19:04
 * @LastEditTime: 2022-07-20 17:25:24
 * @Description: 
 * @FilePath: \learn\HTML\其他\旋转的圣诞树\index.html
-->
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>旋转的圣诞树</title>
    <link rel="stylesheet" href="index.css">
</head>

<body>
    <div class="star"></div>
    <ul class="tree" id="tree"></ul>
    <script>
        // 构造一棵树
        function createTree() {
            for (let i = 0; i < 128; i++) {
                let li = document.createElement('li');
                // --h 线条高度
                // --d 动画延迟时间
                li.style.cssText = `--h:calc(60vh / 128 * ${i});
                --d:calc(-28s / 128 * ${i});`;
                document.getElementById('tree').appendChild(li)
            }
        }
        window.addEventListener('load', () => {

            createTree();
        })
    </script>
</body>

</html>